<?php

if($_SERVER["REQUEST_METHOD"]=="GET"){
    $result=array("msg"=>"抱歉.暂不支持get请求","status"=>-1);
    print_r(json_encode($result));
    return;
}

if(!(isset($_POST["uphone"])&&isset($_POST["upwd"]))){
    $result=array("msg"=>"手机号或密码不能为空","status"=>-2);
    print_r(json_encode($result));
    return;
}

include  "DBhelper.php";

//$uname=$_POST["uname"];
$upwd=$_POST["upwd"];
//$uemail=$_POST["uemail"];
$utelphone=$_POST["uphone"];
//$urealname=$_POST["urealname"];

$sql="INSERT INTO `usermessage` (`upwd`,`utelphone`) 
VALUES('".$upwd."','".$utelphone."')";

// 什么情况下,是状态 插入,删除,修改
// 只有查询返回是一个对象
$resultData=sqlQuery($sql);

if($resultData==1){
    $result=array("msg"=>"注册成功","status"=>1,"data"=>$resultData);
    print_r(json_encode($result));
}else{
    $result=array("msg"=>"注册失败","status"=>-3);
    print_r(json_encode($result));
}